#include "network.h"
#include "mtcnn.h"
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <string>


using namespace std;


int main()
{

     Mat image;
     VideoCapture cap(0);
     if(!cap.isOpened())
         cout<<"fail to open!"<<endl;
     cap>>image;
     if(!image.data){
         cout<<"读取视频失败"<<endl;
         return -1;
     }

     mtcnn find(image.rows, image.cols);
     clock_t start;
     for(;;){
         start = clock();
         cap>>image;
         find.findFace(image);
         resize(image,image,Size(image.cols*2,image.rows*2));
         imshow("result", image);
         if( waitKey(1)>=0 ) break;
         start = clock() -start;
        // cout<<"time is  "<<start/10e3<<endl;
     }

    waitKey(0);
    image.release();
    return 0;
}

